package FileIO.stream;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class useFileInputStream {
    public static void main(String[] args) throws IOException {
        InputStream input = new FileInputStream("src/main/data/hello.txt");
        try {
            byte[] buf = new byte[1024];
            int bytesRead = input.read(buf);
            String data = new String(buf, 0, bytesRead, "utf-8");
            System.out.println(data);
        } finally {
            input.close();
        }
    }
}
